/*************************************************************
 * 
 * CopyRight(c)2007, http://www.moorwind.com/
 * email:ezhung@gmail.com
 * for free, but a email permission would be nice
 * 
 ************************************************************/
package kono.utils.collections
{
	import kono.utils.D3Array;
	
	public class D3ArrayIterator implements Iiterator
	{
		private var _array:Array;
		private var _cursor:uint;
		private var _length:uint;
		
		public function D3ArrayIterator(data:D3Array)
		{
			_array = data.toArray();
			_length = _array.length;
			_cursor = 0;
		}
		public function hasNext():Boolean
		{
			return (_cursor < _length);
		}
		
		public function next():*
		{
			return _array[_cursor++];
		}
		
		public function get data():*
		{
			return _array[_cursor];
		}
		
		public function set data(item:*):void
		{
			_array[_cursor] = item;
		}
		
		public function start():void
		{
			_cursor = 0;
		}
		
	}
}